package org.learn.spark;

import spark.ModelAndView;

import java.util.HashMap;
import java.util.Map;

import static spark.Spark.*;

public class SparkWebTest {
    public static void main(String[] args) {
        port(80);
        get("/hello", (req, res) -> "<a href=\"https://www.baidu.com/\">跳转百度</>");
        get("/add", (req, res) -> {
            Map<String, String> param = req.params();
            return "a";
        });





        get("/index.html", (req, res) -> {

            staticFiles.externalLocation("/static");

            return new ModelAndView(new HashMap(), "html/index.html");
        });



    }
}
